<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>$ajax发送jsonp请求</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>

<body>
    <button id='btn'>$ajax发送jsonp请求</button>
    <script>
        // function fn(res) {
        //     console.log(res);
        // }
        $('#btn').click(function() {
            $.ajax({
                url: '/jsonp',
                dataType: 'jsonp',
                //jsonpCallback: 'fn', //接收的函数
                success: function(res) {
                    console.log(res);
                }
            })
        })
    </script>
</body>

</html>